# Which compiler
# CC = gcc
# AR = ar
# AT = @

# source file
SRCS := ssd1306_fonts.c
SRCS += ssd1306_generic.c
SRCS += ssd1306_1bit.c
SRCS += ssd1306_8bit.c
SRCS += ssd1306_16bit.c
SRCS += ssd1306_menu.c
# SRCS += ssd1306_hal/avr/platform.c
# SRCS += ssd1306_hal/linux/platform.c
# SRCS += ssd1306_hal/mingw/platform.c
# SRCS += ssd1306_hal/stm32/platform.c
# SRCS += ssd1306_hal/template/platform.c
# SRCS += intf/i2c/ssd1306_i2c.c
# SRCS += intf/i2c/ssd1306_i2c_embedded.c
# SRCS += intf/i2c/ssd1306_i2c_twi.c
SRCS += intf/spi/ssd1306_spi.c
# SRCS += intf/spi/ssd1306_spi_avr.c
# SRCS += intf/spi/ssd1306_spi_usi.c
SRCS += intf/ssd1306_interface.c
# SRCS += intf/uart/ssd1306_uart_builtin.c
SRCS += lcd/lcd_common.c
# SRCS += lcd/lcd_pcd8544.c
# SRCS += lcd/lcd_il9163.c
# SRCS += lcd/lcd_ili9341.c
# SRCS += lcd/oled_sh1106.c
SRCS += lcd/oled_ssd1306.c
# SRCS += lcd/oled_ssd1325.c
# SRCS += lcd/oled_ssd1327.c
# SRCS += lcd/oled_ssd1331.c
# SRCS += lcd/oled_ssd1351.c
# SRCS += lcd/oled_template.c
# SRCS += lcd/vga_monitor.c
# SRCS += intf/vga/vga.c
# SRCS += intf/vga/atmega328p/vga128x64.c
# SRCS += intf/vga/atmega328p/vga96x40.c
# SRCS += ssd1306_uart.c


# SRCS_FILE = $(notdir $(SRCS))
# OBJS = $(patsubst %.c,%.o,$(SRCS_FILE))

OBJS = $(patsubst %.c,$(OBJS_PATH)%.o,$(SRCS))

# Where are include files kept
INCLUDES = -Isrc

# Option for development
CFLAGS = -g -Wall
# CXXFLAGS =
# Option for release
# CFLAGS = -O -Wall

TARGET = libolcd.a


all: $(OBJS)
    $(AT)$(AR) rcs $(TARGET) $^
    $(AT)mv $(TARGET) $(LIBS_PATH)

$(OBJS): $(SRCS)
    $(AT)$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@


.PHONY: clean
clean:
    $(AT)-rm -f *.o
